import request from '@/utils/request'

// 文件上传
export function upload(data) {
  return request({
    url: '/file/upload',
    method: 'post',
    data: data
  })
}

// 文件上传
export function getFile(id) {
  return request({
    url: '/system/sysFile/getFile/' + id,
    method: 'get',
    responseType: 'arraybuffer'
  })
}
// 省市区树解构
export function getChinaDivision(params) {
  return request({
    url: '/system/province/getChinaDivision',
    method: 'get',
    params
  })
}

// 角色查询
export function getRole() {
  return request({
    url: '/system/role/list',
    method: 'get'
  })
}

// 承办人
export function lawyer(params) {
  return request({
    url: '/consumer/lawyer/listVO',
    method: 'get',
    params
  })
}
// 承办机构
export function dept(params) {
  return request({
    url: '/system/dept/listVO',
    method: 'get',
    params
  })
}
// 公证人
export function listUserByNewParentId(params) {
  return request({
    url: '/system/user/listUserByNewParentId',
    method: 'get',
    params
  })
}
// 受援人类型列表
export function applicantType() {
  return request({
    url: '/consumer/applicantType/list',
    method: 'get'
  })
}

// 一级案由
export function firstList(params) {
  return request({
    url: '/consumer/first/list',
    method: 'get',
    params
  })
}
// 二级案由
export function secondList(params) {
  return request({
    url: '/consumer/second/list',
    method: 'get',
    params
  })
}
// 三级案由
export function thirdlyList(params) {
  return request({
    url: '/consumer/thirdly/list',
    method: 'get',
    params
  })
}

// 受援人
export function listByNodeOrNewParent(params) {
  return request({
    url: '/system/dept/listByNodeOrNewParent',
    method: 'get',
    params
  })
}

// 市
export function cityList(params) {
  return request({
    url: '/system/city/list',
    method: 'get',
    params
  })
}
// 提交机构
export function listByNodeType(params) {
  return request({
    url: '/system/dept/listByNodeType',
    method: 'get',
    params
  })
}

// 案件流程
export function logList(params) {
  return request({
    url: '/consumer/log/list',
    method: 'get',
    params
  })
}

// 身份证获取信息
export function lawCaseIdCard(data) {
  return request({
    url: '/consumer/lawCase/idCard',
    method: 'post',
    data
  })
}

export function WebSocketAPi(data) {
  return request({
    url: '/system/websocket/socket/push',
    method: 'post',
    data
  })
}

// 受援人信息
export function applicantList(params) {
  return request({
    url: '/consumer/applicant/list',
    method: 'get',
    params
  })
}

// 受援人信息
export function getIndexTotle(params) {
  return request({
    url: '/consumer/index/getIndexTotle',
    method: 'get',
    params
  })
}

// 资料下载列表
export function getMaterialsName(params) {
  return request({
    url: '/consumer/materialsDownload/getMaterialsName',
    method: 'get',
    params
  })
}
// 资料下载
export function getFileLiu(url, id) {
  return request({
    url: `${url}/${id}`,
    method: 'get',
    responseType: 'blob'
  })
}
